/**
 * @projectName: com.xiayuanxing.designPattern
 * @className: LightOffCommand
 * @author: xiayuanxing
 * @description: TODO
 * @date: 2022/1/4 11:23
 * @version: 1.0
 */
public class LightOffCommand implements Command{


    /** 聚合LightReceiver */
    LightReceiver light;


    /** 构造器 */
    public LightOffCommand(LightReceiver light) {
        super();
        this.light = light;
    }

    public void execute() {
        //调用接收者的方法
        light.off();
    }

    public void undo() {
        //调用接收者的方法
        light.on();

    }
}
